/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022.
 * Description: Define the image_header structure and
 *		 the hw_swm_file_head_st structure
 * Author: tanninghao <tanninghao1@huawei.com>
 * Create: 2022-07-13
 */

#ifndef _SQUASHFS_EXTRA_HEADER_H
#define _SQUASHFS_EXTRA_HEADER_H

/* the ont customer magic number */
#define HW_SWM_FILE_HEAD_MAGIC      0x68776877

/*
 * boot from flash
 * should be the same as SWM's struct
 * HW_SWM_FILE_HEAD_S
 */
typedef struct {
		unsigned int   magic;
		char           version[64];
		unsigned int   datetime;
		unsigned int   type;
		unsigned int   len;
		unsigned int   crc;
} hw_swm_file_head_st;

#define HW_SWM_FILE_HEAD_LENGTH  (sizeof(hw_swm_file_head_st) + 1)

typedef struct image_header {
		uint32_t        ih_magic;       /* Image Header Magic Number    */
		uint32_t        ih_hcrc;        /* Image Header CRC Checksum    */
		uint32_t        ih_time;        /* Image Creation Timestamp     */
		uint32_t        ih_size;        /* Image Data Size              */
		uint32_t        ih_load;        /* Data  Load  Address          */
		uint32_t        ih_ep;          /* Entry Point Address          */
		uint32_t        ih_dcrc;        /* Image Data CRC Checksum      */
		uint8_t         ih_os;          /* Operating System             */
		uint8_t         ih_arch;        /* CPU architecture             */
		uint8_t         ih_type;        /* Image Type                   */
		uint8_t         ih_comp;        /* Compression Type             */
		uint8_t         ih_name[32];    /* Image Name           */
} image_header_ttt;
#endif /* _SQUASHFS_EXTRA_HEADER_H */
